package Frame.screen;

import FCRendering.FCRMaster;
import FCRendering.ImageUtil;
import utils.FCUIConfig;
import utils.entity.UIConfigEntity;

import java.awt.*;

import static FCRendering.FCRMaster.fcv;

public class DefaultTeamRequestScreen extends IScreen{


    @Override
    public void dispatchPaintComponent(Graphics g, FCRMaster fcrMaster) {
        if(fcrMaster.fcv.isShowTeamRequest()){
            g.drawImage(ImageUtil.getImage("gamemenuteamrequest"), (int) (532 * fcv.getProportion()),  (int) (343 * fcv.getProportion()),
                    (int) (856 * fcv.getProportion()), (int) (140 * fcv.getProportion()), this);
            g.setColor(new Color(163, 163, 163));
            UIConfigEntity entity = FCUIConfig.getIn().getByKey("TeamRequestReject");
            if(entity != null && entity.getEnterBuKey() == fcv.getEnterBu()){
                g.fillRect(entity.getSelectBuX(), entity.getSelectBuY(), (int) (33 * fcv.getProportion()),
                        (int) (69 * fcv.getProportion()));
            }else {
                entity = FCUIConfig.getIn().getByKey("TeamRequestAccept");
                if(entity != null && entity.getEnterBuKey() == fcv.getEnterBu()){
                    g.fillRect(entity.getSelectBuX(), entity.getSelectBuY(), (int) (33 * fcv.getProportion()),
                            (int) (69 * fcv.getProportion()));
                }
            }
        }
    }

    @Override
    public void setBounds() {

    }
}
